package cgl.hadoopsensorgrid.sensorgrid.util;

import org.apache.hadoop.mapreduce.Partitioner;
import org.apache.hadoop.io.BytesWritable;

/***
 * 
 * Partition based on the partitionID.
 * 
 * @author Chao Sun
 * 
 */
public class serializedTextPartitioner extends
		Partitioner<serializedText, BytesWritable> {

	/**
	 * Override.
	 */
	@Override
	public int getPartition(serializedText key, BytesWritable value,
			int numOfPartitions) {
		return (key.getPID() % numOfPartitions);
	}

}